<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006-2016 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 流年 <liu21st@gmail.com>
// +----------------------------------------------------------------------
//随机验证码
function getcode($begin=0,$end=9,$limit=6){
	$rand_array=range($begin,$end); 
	shuffle($rand_array);  //调用现成的数组随机排列函数 
	$str = array_slice($rand_array,0,$limit);//截取前$limit个 
	return implode(null,$str);
}